package chapter_2.demo_2;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: hero生仔
 */
public class Main {
    public static void main(String[] args) {
        Apple apple01 = new Apple(155, "red");
        Apple apple02 = new Apple(80, "green");
        List<Apple> list = new ArrayList<>();
        list.add(apple01);list.add(apple02);

        /*但是这种很啰嗦，因为你需要声明很多只要实例化一次的类，所以说，这个demo_02是罗嗦版本，还不如demo_01*/
        Apple.prettyPrintApple(list,new AppleFancyFormatter());
        Apple.prettyPrintApple(list,new AppleSimpleFormatter());
    }
}
